//
//  Vertex3.h
//  CompGraf2
//
//  Created by Juan Niosi on 05/10/11.
//  Copyright 2011 __MyCompanyName__. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <OpenGLES/ES1/gl.h>
#import <OpenGLES/ES1/glext.h>
#import <OpenGLES/ES2/gl.h>
#import <OpenGLES/ES2/glext.h>


@interface Vector3 : NSObject
{
    GLfloat *vertices;
}
- (id)init:(GLfloat)x:(GLfloat)y:(GLfloat)z;
- (id)init:(GLfloat *)verts;

- (GLfloat *)getValues;
- (GLfloat)getX;
- (GLfloat)getY;
- (GLfloat)getZ;

- (void)setX:(GLfloat)x;
- (void)setY:(GLfloat)y;
- (void)setZ:(GLfloat)z;

- (void)scale:(GLfloat)scale;

- (void)normalize;
- (GLfloat)length;
- (GLfloat)length2;

- (BOOL)equals:(Vector3 *)vec setDelta:(GLfloat)delta;
- (BOOL)equals:(Vector3 *)vec;
- (Vector3 *)copy;

- (NSString *)toString;

+ (Vector3 *)add:(Vector3 *)a:(Vector3 *)b;
+ (Vector3 *)subtract:(Vector3 *)a:(Vector3 *)b;
+ (Vector3 *)scale:(Vector3 *)vec:(GLfloat)factor;
+ (Vector3 *)yRotationToVec3:(GLfloat)angle;
+ (float)dot:(Vector3 *)a:(Vector3 *)b;
+ (float)dotXZ:(Vector3 *)a:(Vector3 *)b;
+ (float)angle:(Vector3 *)a:(Vector3 *)b;
+ (Vector3 *)yRotationToVec3:(GLfloat)angle;
+ (Vector3 *)lerp:(Vector3 *)from:(Vector3 *)to:(float)delta;
+ (Vector3 *)cross:(Vector3 *)a:(Vector3 *)b;

+ (Vector3 *)up;
+ (Vector3 *)zero;
@end
